<template>
	<div class='container'>
		<div class='box-top'>
			<p>推广赚金</p>
			<img src="@/images/banner.png" alt="">
			<ul class='ul-box'>
        <li>
          <div class='title'>
            <p>受邀商家</p>
          </div>
          <div class='main'>
              <div class='left'>
                   <img src="@/images/left.png" alt="">
              </div>
              <div class='right'>
                  <span>80%</span>
                  <img src="@/images/yj.png" alt="">
                  <div>
                    受邀商家每次发布任务支付的佣金，你可以在佣金的80%作为额外奖励(长期有效).
                  </div>
              </div>
          </div>
        </li>
				<li>
					<div class='title'>
              <p>收益统计</p>
          </div>
					<div class='main'>
						<div class='left'>
							  <img src="@/images/right.png" alt="">
						</div>
						<div class='right'>
							<ul class='li-sort'>
								<li>累计邀请：<span>{{dataList.countUser}}</span>个</li>
								<li>累计分成：<span>{{dataList.countMoney}}</span>金</li>
								<!-- <li>买手累计提成：<span>1</span>金</li> -->
								<!-- <li>商家累计：<span>1</span>金</li> -->
							</ul>
						</div>
					</div>
				</li>
			</ul>
		</div>
		<div class='box-bottom'>
			<div v-if='!dataList.inviter'>我的邀请链接，暂无邀请资格</div>
      <div v-else>
          <span>我的邀请链接：{{inviter}}</span>
          <el-button class='tag-read' :data-clipboard-text="href" type='primary' @click='copy'>复制</el-button>
      </div>
		</div>
		<div class='table'>
				<el-table
			:data="secondList"
			style="width: 100%;"
			height='470'>
			<el-table-column
				prop="username"
				label="用户名">
			</el-table-column>
			<el-table-column
				prop="qq"
				label="QQ">
			</el-table-column>
			<el-table-column
				prop="created_time"
				label="注册时间">
			</el-table-column>
			<el-table-column
				prop="store_money"
				label="余额">
			</el-table-column>
			<el-table-column
				prop="sumNum"
				label="总单数">
			</el-table-column>
			<el-table-column
				prop="sumPrincipal"
				label="本金">
			</el-table-column>
			<el-table-column
				prop="sumCommission"
				label="佣金">
			</el-table-column>
			<el-table-column
				prop="sumConsumption"
				label="总消费">
			</el-table-column>
			<el-table-column
				prop="sunStoreCommission"
				label="我的提成">
			</el-table-column>
			<el-table-column
				prop="state"
				label="状态">
			</el-table-column>
			<el-table-column
				prop="address"
				label="操作">
				 <template slot-scope="scope">
					 <el-button
						size="mini"
						type="primary"
						plain
						@click="handleEdit(scope.$index, scope.row)">设置价格
				   	</el-button>
         </template>
			</el-table-column>
			</el-table>
		</div>
    <!-- 弹框 -->
    <el-dialog
      title="设置佣金"
      :visible.sync="dialogVisible"
      width="30%"
      :before-close="handleClose">
           <el-radio-group v-model="type">
              <el-radio :label="1" class='radio-block'>默认模式（固定提成1元）</el-radio>
              <el-radio :label="2" class='radio-block'>二八分模式（提成/0.8=自定义价格-成本价）</el-radio>
            </el-radio-group>
              <el-table
      :data="tableData"
      class='dialog-table'
      style="width: 100%">
      <el-table-column
        prop="level"
        label="商品价格"
        width="180">
      </el-table-column>
      <el-table-column
        prop="value"
        label="成本价格"
        width="180">
      </el-table-column>
      <el-table-column
        label="自定义价格">
        <template slot-scope='{row}'>
             <el-input size='mini' :disabled='type==1?true:false' v-model='row.defaultValue' v-if="type==1"></el-input>
             <el-input size='mini' :disabled='type==1?true:false' v-model='row.value2' v-else></el-input>
        </template>
      </el-table-column>
    </el-table>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click='quit'>确 定</el-button>
      </span>
    </el-dialog>
      <div class="block">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="params.pageIndex"
      :page-size="params.pageSize"
      layout="total, prev, pager, next, jumper"
      :total="count">
    </el-pagination>
  </div>
	</div>
</template>
<script src='./AppealCenter.js'>

</script>
<style lang='scss' scoped>
	@import './AppealCenter.scss';
</style>
